cmake_minimum_required(VERSION 3.18)
project(ScreenShot)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CURRENT_SOURCE_DIR ON)
set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)

add_executable(${PROJECT_NAME} main.cpp ScreenShot.cpp ScreenShot.h)
target_precompile_headers(${PROJECT_NAME} PRIVATE pch.h)

find_package(Qt5 COMPONENTS Core Widgets Gui LinguistTools)
include_directories(Qt5::Core Qt5::Widgets Qt5::Gui)
target_link_libraries(${PROJECT_NAME} Qt5::Core Qt5::Widgets Qt5::Gui)

# 创建库
add_library(PartialShot
        STATIC
        PartialShot.cpp PartialShot.h)

target_link_libraries(${PROJECT_NAME} PartialShot)
target_link_libraries(PartialShot Qt5::Core Qt5::Widgets Qt5::Gui)